package com.bluemobi.system.service;

import java.util.Map;

import com.bluemobi.framework.base.BaseService;
import com.bluemobi.framework.base.Page;
import com.bluemobi.system.model.SysUser;

/**
 * 系统用户管理service
 */
public interface SysUserService extends BaseService {

	/**
	 * 根据登录名称获取系统用户登录信息
	 *
	 * @param loginName
	 *            登录名称
	 * @return SysUser
	 * @throws Exception
	 */
	SysUser getSysUserByLoginName(String loginName) throws Exception;

	/**
	 * 根据用户拥有的组织机构获取所有归属用户
	 *
	 * @param page
	 *            分页
	 * @param searchParams
	 *            参数
	 * @return Page
	 * @throws Exception
	 */
	Page getUserListByOrgIds(Page page, @SuppressWarnings("rawtypes") Map searchParams) throws Exception;

	/**
	 * 添加用户
	 *
	 * @param sysUser
	 *            用户信息
	 * @return boolean
	 * @throws Exception
	 */
	boolean saveSysUser(SysUser sysUser) throws Exception;

	/**
	 * 修改用户
	 *
	 * @param sysUser
	 *            用户信息
	 * @return boolean
	 * @throws Exception
	 */
	boolean updateSysUser(SysUser sysUser) throws Exception;

	/**
	 * 删除用户
	 *
	 * @param suId
	 *            用户ID
	 * @return boolean
	 * @throws Exception
	 */
	boolean delUserBySuId(String suId) throws Exception;

	/**
	 * 重置用户密码
	 *
	 * @param suId
	 *            用户ID
	 * @param loginName
	 *            登录名称
	 * @return boolean
	 * @throws Exception
	 */
	boolean updatePwd(String suId, String loginName) throws Exception;

	/**
	 * 用户修改密码
	 *
	 * @param sysUser
	 *            用户信息
	 * @param newPwd
	 *            新密码
	 * @return boolean
	 * @throws Exception
	 */
	boolean updatePwd(SysUser sysUser, String newPwd) throws Exception;
}
